package com.itheima;

import com.itheima.domain.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.Map;

@Controller
@RequestMapping("/user")
public class UserController {
    @RequestMapping(value = "/reg")
    @ResponseBody
    public Map reg(@RequestBody User user){
        System.out.println(user);

        HashMap<String, Object> map = new HashMap<>();
        map.put("flag",true);
        map.put("message","注册成功");

        return map;
    }
}
